//
//  UIImage+DZCategory.m
//  DZFoundation
//
//  Created by Darren on 15/5/28.
//  Copyright (c) 2015年 Darren Zheng. All rights reserved.
//

#import "UIImage+DZCategory.h"

@implementation UIImage (DZCategory)

- (UIImage *)resizedImageWithWidth:(CGFloat)width
                            height:(CGFloat)height
                            opaque:(BOOL)bOpaque
                             scale:(CGFloat)fScale
{
    UIGraphicsBeginImageContextWithOptions(CGSizeMake(width, height), bOpaque, fScale);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetInterpolationQuality(context, kCGInterpolationDefault);
    [self drawInRect:CGRectMake(0.0, 0.0, width, height)];
    UIImage *resizedImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return resizedImage;
}


@end
